const state = {
  contrastList: [],
  createComb: [],
  createComb_id: 0, // 当前创建组合createComb的长度
}

const mutations = {
  // 添加对比
  addContrastList: (state, obj) => {
    state.contrastList = [...state.contrastList, obj]
  },
  removeContrastList: (state, i) => {
    state.contrastList.splice(i, 1)
  },
  clearContrastList: state => {
    state.contrastList = []
  },

  // 创建组合
  addCreateComb: (state, obj) => {
    state.createComb_id = Object.keys(state.createComb).length
    state.createComb.push(obj)
  },
}

export default {
  namespaced: true,
  state,
  mutations
}

